﻿@inherits TestComponentBase

<Fixture Test=MarkupPassedViaChildContent>
    <ComponentUnderTest>
        <ThemedButton>
            <h1>Foo bar button</h1>
        </ThemedButton>
    </ComponentUnderTest>
    <Fragment><h1>Foo bar button</h1></Fragment>
</Fixture>
@code {
    void MarkupPassedViaChildContent()
    {
        var expectedChildContent = GetFragment();

        var cut = GetComponentUnderTest();

        cut.Find("button").ChildNodes.MarkupMatches(expectedChildContent);
    }
}

<Fixture>
    <ComponentUnderTest>
        <ThemedElement>
            <ThemedButton id="btn">@btnContent</ThemedButton>
        </ThemedElement>
    </ComponentUnderTest>
</Fixture>
@code {
    string btnContent = "BUTTTOOOON";
    void ComponentsPassedViaChildContent()
    {
        var cut = GetComponentUnderTest();

        cut.Find("#btn").TextContent.ShouldBe(btnContent);
    }
}